ifneq ($(NOT_SUPPORT_SP), y)
    EXTRA_CFLAGS += -fstack-protector-all
endif

ccflags-y += -Wall -Werror

ifeq ($(TOP_DIR),)
    MAKE_PRODUCT := $(PRODUCT)
    ifeq ($(DAVINCI_HIAI_DKMS),y)
        EXTRA_CFLAGS += -DDRV_HOST
        EXTRA_CFLAGS += -I$(HIAI_DKMS_DIR)/dev_inc_open/inc \
            -I$(HIAI_DKMS_DIR)/dev_inc/inc \
            -I$(HIAI_DKMS_DIR)/queue/host/common \
            -I$(HIAI_DKMS_DIR)/queue/host \
            -I$(HIAI_DKMS_DIR)/inc/driver \
            -I$(HIAI_DKMS_DIR)/libc_sec/include

        obj-m   += ascend_queue.o    # host
        ascend_queue-objs := common/queue_module.o common/queue_context.o common/queue_dma.o queue_fops.o queue_host_msg.o queue_ctx_private.o common/queue_proc_fs.o common/queue_status_record.o common/queue_channel.o
    else
       ccflags-y += -Wtrampolines $(WDATE_TIME) -Wfloat-equal -Wvla -Wundef -funsigned-char -Wformat=2 -Wstack-usage=2048 -Wcast-align -Wextra
       ccflags-y += -Wno-unused-parameter -Wno-missing-field-initializers -Wno-sign-compare
    endif
else
    MAKE_PRODUCT := $(PRODUCT)
    ifeq ($(DAVINCI_HIAI_DKMS),y)

    else
        ccflags-y += -Wtrampolines $(WDATE_TIME) -Wfloat-equal -Wvla -Wundef -funsigned-char -Wformat=2 -Wstack-usage=2048 -Wcast-align -Wextra
        ccflags-y += -Wno-unused-parameter -Wno-missing-field-initializers -Wno-sign-compare
        EXTRA_CFLAGS += -DDRV_HOST
        EXTRA_CFLAGS += -I$(DRIVER_OPEN_KERNEL_DIR)/inc \
            -I$(DRIVER_KERNEL_DIR)/inc \
            -I$(DRIVER_KERNEL_DIR)/src/queue/host/common \
            -I$(DRIVER_KERNEL_DIR)/src/queue/host \
            -I$(TOP_DIR)/inc/driver \
            -I$(TOP_DIR)/abl/libc_sec/include

        obj-m   += ascend_queue.o    # host
        ascend_queue-objs := common/queue_module.o common/queue_context.o common/queue_dma.o common/queue_proc_fs.o common/queue_status_record.o queue_fops.o queue_host_msg.o queue_ctx_private.o common/queue_channel.o
    endif
endif
